package router

import (
	"github.com/gin-gonic/gin"
	"wechats/handler/service"
)

func Router() *gin.Engine {
	r := gin.Default()
	r.POST("/sendSms", service.SendSms)

	ApiUser := r.Group("/api/user")
	ApiFriend := r.Group("/api/friend")
	ApiChat := r.Group("/api/chat")
	ApiMoments := r.Group("/api/moments")
	//用户路由组
	ApiUser.POST("/register", service.Register)
	ApiUser.POST("/login", service.Login)

	//好友路由组
	ApiFriend.GET("/friendSList", service.FriendSList)
	ApiFriend.POST("/friendAdd", service.FriendAdd)
	ApiFriend.POST("/friendUpdate", service.FriendUpdate)
	ApiFriend.GET("/friendList", service.FriendList)
	ApiFriend.POST("/blackAdd", service.BlackAdd)
	ApiFriend.GET("/blackDList", service.BlackDList)
	//聊天路由组
	ApiChat.GET("/chat", service.Chat)
	ApiChat.GET("/liaoList", service.LiaoList)
	//朋友圈路由组
	ApiMoments.POST("/momentsAdd", service.MomentsAdd)
	ApiMoments.GET("/momentsList", service.MomentsList)
	ApiMoments.POST("/likesAdd", service.LikesAdd)

	return r

}
